<!DOCTYPE html>
<html lang="zh-Hans-CN">
<head>
    <meta charset="UTF-8">
    <title> 内置指令:v-if v-show显示与隐藏</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="../vue.js"></script>
</head>
<body>
<h2>【例16】内置指令:v-if v-show显示与隐藏</h2>
<hr>
<div id="app">
    <button @click="isShow=!isShow">显示/隐藏</button>
    <p>v-show不显示本质是 style="display:none"</p>
    <p v-if="isShow" style="background-color:#ccc;">我是v-if段落。</p>
    <p v-show="isShow" style="background-color:#ccc;">我是v-show段落。</p>
</div>
<script>
    let vm = new Vue({
        el: '#app',
        data: {
            isShow: true
        }
    })
</script>
<hr>
<p><a href="index.html">返回章节目录</a>
    <script>document.write(document.lastModified); </script>
</p>
</body>
</html>
